import request from '@/utils/request'
// 配置公共的header
const headers = {
  'Content-Type': 'application/json;charset=utf-8'
}

export function processList(data) {
  return request({
    url: '/web/activiti/getModelList',
    method: 'post',
    data: data,
    ...headers
  })
}
export function delProcess(data) {
  return request({
    url: '/web/activiti/delModel',
    method: 'post',
    data: data,
    ...headers
  })
}
export function pubProcess(data) {
  return request({
    url: '/web/activiti/publish',
    method: 'post',
    data: data,
    ...headers
  })
}
export function addInstance(data) {
  return request({
    url: '/web/activiti/addInstance',
    method: 'post',
    data: data,
    ...headers
  })
}
export function myTaskList(data) {
  return request({
    url: '/web/activiti/getMyTaskList',
    method: 'post',
    data: data,
    ...headers
  })
}
export function completeTask(data) {
  return request({
    url: '/web/activiti/completeMyTask',
    method: 'post',
    data: data,
    ...headers
  })
}
export function myHiTaskList(data) {
  return request({
    url: '/web/activiti/getMyHiTask',
    method: 'post',
    data: data,
    ...headers
  })
}
/**
 * @name findListLcbds
 * @description 流程表达式页面-列表
 * @author wqy
 * @date 2020-06-09 15:20:54
*/
export function findListLcbds(data) {
  return request({
    url: '/web/actExtExpression/findList',
    method: 'post',
    data: data,
    ...headers
  })
}
/**
 * @name addLcbds
 * @description 流程表达式页面-删除操作
 * @author wqy
 * @date 2020-06-09 15:20:54
*/
export function addLcbds(data) {
  return request({
    url: '/web/actExtExpression/add',
    method: 'post',
    data: data,
    ...headers
  })
}
/**
 * @name editLcbds
 * @description 流程表达式页面-编辑操作
 * @author wqy
 * @date 2020-06-09 15:20:54
*/
export function editLcbds(data) {
  return request({
    url: '/web/actExtExpression/edit',
    method: 'post',
    data: data,
    ...headers
  })
}
/**
 * @name deleteLcbds
 * @description 流程表达式页面-删除操作
 * @author wqy
 * @date 2020-06-09 15:20:54
*/
export function deleteLcbds(data = {}) {
  return request({
    url: '/web/actExtExpression/delete',
    method: 'get',
    params: data
  })
}
/**
 * @name selectInstanceList
 * @description 获取流程的实列列表
 * @param {
 *  isFinish  1 已完成流程  2未完成流程
 *  key 流程的key
 *  pageNum
 *  pageSize
 *  instanceId  实例id
 *  searchName 实例名称
 * }
 * @author cjs
 * @date 2021-04-30 09:15:35
 */
export function selectInstanceList(data = {}) {
  return request({
    method: "post",
    url: "/online/cgform/act/selectInstanceList",
    data
  });
}
